In [12]:
from src.NSGData import NSGData, GaborSystemParams
from src.GaborSystem import Oct
...

Reconstruction¶

In [11]:
guitar = NSGData.from_wav("./samples/guitar.wav", 
GaborSystemParams(
    scale=Oct,
    n_b=60,
    fmin=30,
    fmax=22000,
    fs=44100,
    Ls=44100,
    reducedform=0
))

guitar.to_tiff("./images/guitar.tiff")

guitar_r = NSGData.from_tiff("./images/guitar.tiff")

guitar.show()

from torch import allclose
allclose(guitar.s, guitar_r.s, atol=1e-7)
torch.Size([2, 575, 87782])
Saved complex spectrogram to ./images/guitar.tiff with (2, 575, 87782) shape
Importing tiff c with shape:  torch.Size([2, 575, 87782])
torch.Size([575, 87782])
Out[11]:
True
No description has been provided for this image

Phase experiment¶

Original audio¶

In [12]:
speech = NSGData.from_wav("./samples/speech.wav", 
GaborSystemParams(
    scale=Oct,
    n_b=120,
    fmin=30,
    fmax=24000,
    fs=None,    
    Ls=None,
    reducedform=0
))

speech.to_tiff("./images/speech.tiff")
speech.audio();
speech.show();
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 30.00,30.17,30.35,30.52,30.70,30.88,31.06,31.24,31.42,31.60,31.78,31.97,32.15,32.34,32.53,32.71,32.90,33.09,33.28,33.48,33.67,33.87,34.06,34.26,34.46,34.66,34.86,35.06,35.26,35.47,35.67,35.88,36.09,36.30,36.51,36.72,36.93,37.14,37.36,37.57,37.79,38.01,38.23,38.45,38.67,38.90,39.12,39.35,39.58,39.81,40.04,40.27,40.50,40.74,40.97,41.21,41.45,41.69,41.93,42.17,42.42,42.66,42.91,43.16,43.41,43.66,43.91,44.17,44.42,44.68,44.94,45.20,45.46,45.72,45.99,46.25,46.52,46.79,47.06,47.33,47.61,47.88,48.16,48.44,48.72,49.00,49.29,49.57,49.86,50.15,50.44,50.73,51.02,51.32,51.62,51.91,52.21,52.52,52.82,53.13,53.43,53.74,54.05,54.37,54.68,55.00,55.32,55.64,55.96,56.28,56.61,56.94,57.27,57.60,57.93,58.27,58.60,58.94,59.29,59.63,59.97,60.32,60.67,61.02,61.37,61.73,62.09,62.45,62.81,63.17,63.54,63.91,64.28,64.65,65.02,65.40,65.78,66.16,66.54,66.93,67.31,67.70,68.10,68.49,68.89,69.28,69.69,70.09,70.49,70.90,71.31,71.73,72.14,72.56,72.98,73.40,73.83,74.25,74.68,75.12,75.55,75.99,76.43,76.87,77.32,77.76,78.21,78.67,79.12,79.58,80.04,80.50,80.97,81.44,81.91,82.38,82.86,83.34,83.82,84.31,84.80,85.29,85.78,86.28,86.78,87.28,87.79,88.29,88.81,89.32,89.84,90.36,90.88,91.41,91.93,92.47,93.00,93.54,94.08,94.63,95.17,95.73,96.28,96.84,97.40,97.96,98.53,99.10,99.67,100.25,100.83,101.41,102.00,102.59,103.19,103.78,104.38,104.99,105.60,106.21,106.82,107.44,108.06,108.69,109.32,109.95,110.59,111.23,111.87,112.52,113.17,113.83,114.48,115.15,115.81,116.48,117.16,117.84,118.52,119.21,119.90,120.59,121.29,121.99,122.70,123.41,124.12,124.84,125.56,126.29,127.02,127.76,128.49,129.24,129.99,130.74,131.50,132.26,133.02,133.79,134.57,135.35,136.13,136.92,137.71,138.51,139.31,140.12,140.93,141.74,142.56,143.39,144.22,145.06,145.89,146.74,147.59,148.44,149.30,150.17,151.04,151.91,152.79,153.67,154.56,155.46,156.36,157.26,158.18,159.09,160.01,160.94,161.87,162.81,163.75,164.70,165.65,166.61,167.57,168.54,169.52,170.50,171.49,172.48,173.48,174.48,175.49,176.51,177.53,178.56,179.59,180.63,181.68,182.73,183.79,184.85,185.92,187.00,188.08,189.17,190.27,191.37,192.48,193.59,194.71,195.84,196.97,198.11,199.26,200.41,201.57,202.74,203.91,205.09,206.28,207.48,208.68,209.88,211.10,212.32,213.55,214.79,216.03,217.28,218.54,219.80,221.08,222.36,223.64,224.94,226.24,227.55,228.87,230.19,231.53,232.87,234.21,235.57,236.93,238.31,239.69,241.07,242.47,243.87,245.28,246.70,248.13,249.57,251.01,252.47,253.93,255.40,256.88,258.36,259.86,261.36,262.88,264.40,265.93,267.47,269.02,270.58,272.14,273.72,275.30,276.90,278.50,280.11,281.73,283.36,285.00,286.65,288.31,289.98,291.66,293.35,295.05,296.76,298.48,300.20,301.94,303.69,305.45,307.22,308.99,310.78,312.58,314.39,316.21,318.04,319.88,321.74,323.60,325.47,327.36,329.25,331.16,333.07,335.00,336.94,338.89,340.85,342.83,344.81,346.81,348.82,350.84,352.87,354.91,356.96,359.03,361.11,363.20,365.30,367.42,369.55,371.68,373.84,376.00,378.18,380.37,382.57,384.78,387.01,389.25,391.51,393.77,396.05,398.34,400.65,402.97,405.30,407.65,410.01,412.38,414.77,417.17,419.59,422.02,424.46,426.92,429.39,431.87,434.37,436.89,439.42,441.96,444.52,447.09,449.68,452.29,454.90,457.54,460.19,462.85,465.53,468.22,470.94,473.66,476.40,479.16,481.94,484.73,487.53,490.35,493.19,496.05,498.92,501.81,504.71,507.64,510.57,513.53,516.50,519.49,522.50,525.53,528.57,531.63,534.71,537.80,540.92,544.05,547.20,550.36,553.55,556.76,559.98,563.22,566.48,569.76,573.06,576.38,579.71,583.07,586.45,589.84,593.26,596.69,600.14,603.62,607.11
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
torch.Size([2, 1146, 287])
Saved complex spectrogram to ./images/speech.tiff with (2, 1146, 287) shape
Your browser does not support the audio element.
No description has been provided for this image

Phase experiment - noise with speech phase components¶

In [13]:
speech_phase = NSGData.from_tiff("./edited/speech_phase.tiff")
speech_phase.audio()
speech_phase.show()
Importing tiff c with shape:  torch.Size([2, 1146, 287])
torch.Size([1146, 287])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 30.00,30.17,30.35,30.52,30.70,30.88,31.06,31.24,31.42,31.60,31.78,31.97,32.15,32.34,32.53,32.71,32.90,33.09,33.28,33.48,33.67,33.87,34.06,34.26,34.46,34.66,34.86,35.06,35.26,35.47,35.67,35.88,36.09,36.30,36.51,36.72,36.93,37.14,37.36,37.57,37.79,38.01,38.23,38.45,38.67,38.90,39.12,39.35,39.58,39.81,40.04,40.27,40.50,40.74,40.97,41.21,41.45,41.69,41.93,42.17,42.42,42.66,42.91,43.16,43.41,43.66,43.91,44.17,44.42,44.68,44.94,45.20,45.46,45.72,45.99,46.25,46.52,46.79,47.06,47.33,47.61,47.88,48.16,48.44,48.72,49.00,49.29,49.57,49.86,50.15,50.44,50.73,51.02,51.32,51.62,51.91,52.21,52.52,52.82,53.13,53.43,53.74,54.05,54.37,54.68,55.00,55.32,55.64,55.96,56.28,56.61,56.94,57.27,57.60,57.93,58.27,58.60,58.94,59.29,59.63,59.97,60.32,60.67,61.02,61.37,61.73,62.09,62.45,62.81,63.17,63.54,63.91,64.28,64.65,65.02,65.40,65.78,66.16,66.54,66.93,67.31,67.70,68.10,68.49,68.89,69.28,69.69,70.09,70.49,70.90,71.31,71.73,72.14,72.56,72.98,73.40,73.83,74.25,74.68,75.12,75.55,75.99,76.43,76.87,77.32,77.76,78.21,78.67,79.12,79.58,80.04,80.50,80.97,81.44,81.91,82.38,82.86,83.34,83.82,84.31,84.80,85.29,85.78,86.28,86.78,87.28,87.79,88.29,88.81,89.32,89.84,90.36,90.88,91.41,91.93,92.47,93.00,93.54,94.08,94.63,95.17,95.73,96.28,96.84,97.40,97.96,98.53,99.10,99.67,100.25,100.83,101.41,102.00,102.59,103.19,103.78,104.38,104.99,105.60,106.21,106.82,107.44,108.06,108.69,109.32,109.95,110.59,111.23,111.87,112.52,113.17,113.83,114.48,115.15,115.81,116.48,117.16,117.84,118.52,119.21,119.90,120.59,121.29,121.99,122.70,123.41,124.12,124.84,125.56,126.29,127.02,127.76,128.49,129.24,129.99,130.74,131.50,132.26,133.02,133.79,134.57,135.35,136.13,136.92,137.71,138.51,139.31,140.12,140.93,141.74,142.56,143.39,144.22,145.06,145.89,146.74,147.59,148.44,149.30,150.17,151.04,151.91,152.79,153.67,154.56,155.46,156.36,157.26,158.18,159.09,160.01,160.94,161.87,162.81,163.75,164.70,165.65,166.61,167.57,168.54,169.52,170.50,171.49,172.48,173.48,174.48,175.49,176.51,177.53,178.56,179.59,180.63,181.68,182.73,183.79,184.85,185.92,187.00,188.08,189.17,190.27,191.37,192.48,193.59,194.71,195.84,196.97,198.11,199.26,200.41,201.57,202.74,203.91,205.09,206.28,207.48,208.68,209.88,211.10,212.32,213.55,214.79,216.03,217.28,218.54,219.80,221.08,222.36,223.64,224.94,226.24,227.55,228.87,230.19,231.53,232.87,234.21,235.57,236.93,238.31,239.69,241.07,242.47,243.87,245.28,246.70,248.13,249.57,251.01,252.47,253.93,255.40,256.88,258.36,259.86,261.36,262.88,264.40,265.93,267.47,269.02,270.58,272.14,273.72,275.30,276.90,278.50,280.11,281.73,283.36,285.00,286.65,288.31,289.98,291.66,293.35,295.05,296.76,298.48,300.20,301.94,303.69,305.45,307.22,308.99,310.78,312.58,314.39,316.21,318.04,319.88,321.74,323.60,325.47,327.36,329.25,331.16,333.07,335.00,336.94,338.89,340.85,342.83,344.81,346.81,348.82,350.84,352.87,354.91,356.96,359.03,361.11,363.20,365.30,367.42,369.55,371.68,373.84,376.00,378.18,380.37,382.57,384.78,387.01,389.25,391.51,393.77,396.05,398.34,400.65,402.97,405.30,407.65,410.01,412.38,414.77,417.17,419.59,422.02,424.46,426.92,429.39,431.87,434.37,436.89,439.42,441.96,444.52,447.09,449.68,452.29,454.90,457.54,460.19,462.85,465.53,468.22,470.94,473.66,476.40,479.16,481.94,484.73,487.53,490.35,493.19,496.05,498.92,501.81,504.71,507.64,510.57,513.53,516.50,519.49,522.50,525.53,528.57,531.63,534.71,537.80,540.92,544.05,547.20,550.36,553.55,556.76,559.98,563.22,566.48,569.76,573.06,576.38,579.71,583.07,586.45,589.84,593.26,596.69,600.14,603.62,607.11
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Phase experiment - speech with noise phase components¶

In [14]:
noise_speech = NSGData.from_tiff("./edited/noise_speech.tiff")
noise_speech.audio()
noise_speech.show()
Importing tiff c with shape:  torch.Size([2, 1146, 287])
torch.Size([1146, 287])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 30.00,30.17,30.35,30.52,30.70,30.88,31.06,31.24,31.42,31.60,31.78,31.97,32.15,32.34,32.53,32.71,32.90,33.09,33.28,33.48,33.67,33.87,34.06,34.26,34.46,34.66,34.86,35.06,35.26,35.47,35.67,35.88,36.09,36.30,36.51,36.72,36.93,37.14,37.36,37.57,37.79,38.01,38.23,38.45,38.67,38.90,39.12,39.35,39.58,39.81,40.04,40.27,40.50,40.74,40.97,41.21,41.45,41.69,41.93,42.17,42.42,42.66,42.91,43.16,43.41,43.66,43.91,44.17,44.42,44.68,44.94,45.20,45.46,45.72,45.99,46.25,46.52,46.79,47.06,47.33,47.61,47.88,48.16,48.44,48.72,49.00,49.29,49.57,49.86,50.15,50.44,50.73,51.02,51.32,51.62,51.91,52.21,52.52,52.82,53.13,53.43,53.74,54.05,54.37,54.68,55.00,55.32,55.64,55.96,56.28,56.61,56.94,57.27,57.60,57.93,58.27,58.60,58.94,59.29,59.63,59.97,60.32,60.67,61.02,61.37,61.73,62.09,62.45,62.81,63.17,63.54,63.91,64.28,64.65,65.02,65.40,65.78,66.16,66.54,66.93,67.31,67.70,68.10,68.49,68.89,69.28,69.69,70.09,70.49,70.90,71.31,71.73,72.14,72.56,72.98,73.40,73.83,74.25,74.68,75.12,75.55,75.99,76.43,76.87,77.32,77.76,78.21,78.67,79.12,79.58,80.04,80.50,80.97,81.44,81.91,82.38,82.86,83.34,83.82,84.31,84.80,85.29,85.78,86.28,86.78,87.28,87.79,88.29,88.81,89.32,89.84,90.36,90.88,91.41,91.93,92.47,93.00,93.54,94.08,94.63,95.17,95.73,96.28,96.84,97.40,97.96,98.53,99.10,99.67,100.25,100.83,101.41,102.00,102.59,103.19,103.78,104.38,104.99,105.60,106.21,106.82,107.44,108.06,108.69,109.32,109.95,110.59,111.23,111.87,112.52,113.17,113.83,114.48,115.15,115.81,116.48,117.16,117.84,118.52,119.21,119.90,120.59,121.29,121.99,122.70,123.41,124.12,124.84,125.56,126.29,127.02,127.76,128.49,129.24,129.99,130.74,131.50,132.26,133.02,133.79,134.57,135.35,136.13,136.92,137.71,138.51,139.31,140.12,140.93,141.74,142.56,143.39,144.22,145.06,145.89,146.74,147.59,148.44,149.30,150.17,151.04,151.91,152.79,153.67,154.56,155.46,156.36,157.26,158.18,159.09,160.01,160.94,161.87,162.81,163.75,164.70,165.65,166.61,167.57,168.54,169.52,170.50,171.49,172.48,173.48,174.48,175.49,176.51,177.53,178.56,179.59,180.63,181.68,182.73,183.79,184.85,185.92,187.00,188.08,189.17,190.27,191.37,192.48,193.59,194.71,195.84,196.97,198.11,199.26,200.41,201.57,202.74,203.91,205.09,206.28,207.48,208.68,209.88,211.10,212.32,213.55,214.79,216.03,217.28,218.54,219.80,221.08,222.36,223.64,224.94,226.24,227.55,228.87,230.19,231.53,232.87,234.21,235.57,236.93,238.31,239.69,241.07,242.47,243.87,245.28,246.70,248.13,249.57,251.01,252.47,253.93,255.40,256.88,258.36,259.86,261.36,262.88,264.40,265.93,267.47,269.02,270.58,272.14,273.72,275.30,276.90,278.50,280.11,281.73,283.36,285.00,286.65,288.31,289.98,291.66,293.35,295.05,296.76,298.48,300.20,301.94,303.69,305.45,307.22,308.99,310.78,312.58,314.39,316.21,318.04,319.88,321.74,323.60,325.47,327.36,329.25,331.16,333.07,335.00,336.94,338.89,340.85,342.83,344.81,346.81,348.82,350.84,352.87,354.91,356.96,359.03,361.11,363.20,365.30,367.42,369.55,371.68,373.84,376.00,378.18,380.37,382.57,384.78,387.01,389.25,391.51,393.77,396.05,398.34,400.65,402.97,405.30,407.65,410.01,412.38,414.77,417.17,419.59,422.02,424.46,426.92,429.39,431.87,434.37,436.89,439.42,441.96,444.52,447.09,449.68,452.29,454.90,457.54,460.19,462.85,465.53,468.22,470.94,473.66,476.40,479.16,481.94,484.73,487.53,490.35,493.19,496.05,498.92,501.81,504.71,507.64,510.57,513.53,516.50,519.49,522.50,525.53,528.57,531.63,534.71,537.80,540.92,544.05,547.20,550.36,553.55,556.76,559.98,563.22,566.48,569.76,573.06,576.38,579.71,583.07,586.45,589.84,593.26,596.69,600.14,603.62,607.11
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Separation by subtraction - original audio¶

In [17]:
electro_masking = NSGData.from_wav("./samples/electro_masking.wav", 
GaborSystemParams(
    scale=Oct,
    n_b=120,
    fmin=28,
    fmax=24000,
    fs=None,
    Ls=None,
    reducedform=0
))

electro_masking.to_tiff("./images/electro_masking.tiff", colormode="miniswhite")

electro_masking.audio()
electro_masking.show()
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.16,28.33,28.49,28.65,28.82,28.99,29.15,29.32,29.49,29.66,29.84,30.01,30.18,30.36,30.53,30.71,30.89,31.07,31.25,31.43,31.61,31.79,31.98,32.16,32.35,32.53,32.72,32.91,33.10,33.29,33.49,33.68,33.88,34.07,34.27,34.47,34.67,34.87,35.07,35.27,35.48,35.68,35.89,36.10,36.31,36.52,36.73,36.94,37.15,37.37,37.58,37.80,38.02,38.24,38.46,38.69,38.91,39.13,39.36,39.59,39.82,40.05,40.28,40.51,40.75,40.98,41.22,41.46,41.70,41.94,42.18,42.43,42.67,42.92,43.17,43.42,43.67,43.92,44.18,44.43,44.69,44.95,45.21,45.47,45.73,46.00,46.27,46.53,46.80,47.07,47.35,47.62,47.90,48.17,48.45,48.73,49.01,49.30,49.58,49.87,50.16,50.45,50.74,51.04,51.33,51.63,51.93,52.23,52.53,52.83,53.14,53.45,53.76,54.07,54.38,54.70,55.01,55.33,55.65,55.97,56.30,56.62,56.95,57.28,57.61,57.95,58.28,58.62,58.96,59.30,59.64,59.99,60.34,60.69,61.04,61.39,61.75,62.10,62.46,62.82,63.19,63.55,63.92,64.29,64.66,65.04,65.41,65.79,66.17,66.56,66.94,67.33,67.72,68.11,68.51,68.90,69.30,69.70,70.11,70.51,70.92,71.33,71.74,72.16,72.58,73.00,73.42,73.84,74.27,74.70,75.13,75.57,76.01,76.45,76.89,77.33,77.78,78.23,78.69,79.14,79.60,80.06,80.52,80.99,81.46,81.93,82.40,82.88,83.36,83.84,84.33,84.82,85.31,85.80,86.30,86.80,87.30,87.81,88.31,88.83,89.34,89.86,90.38,90.90,91.43,91.96,92.49,93.02,93.56,94.10,94.65,95.20,95.75,96.30,96.86,97.42
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
torch.Size([2, 1172, 1951])
Saved complex spectrogram to ./images/electro_masking.tiff with (2, 1172, 1951) shape
Your browser does not support the audio element.
No description has been provided for this image

Seperation by subtraction¶

In [18]:
masking_edited = NSGData.from_tiff("./edited/masking.tiff")
masking_edited.audio()
masking_edited.show()
Importing tiff c with shape:  torch.Size([2, 1172, 1951])
torch.Size([1172, 1951])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.16,28.33,28.49,28.65,28.82,28.99,29.15,29.32,29.49,29.66,29.84,30.01,30.18,30.36,30.53,30.71,30.89,31.07,31.25,31.43,31.61,31.79,31.98,32.16,32.35,32.53,32.72,32.91,33.10,33.29,33.49,33.68,33.88,34.07,34.27,34.47,34.67,34.87,35.07,35.27,35.48,35.68,35.89,36.10,36.31,36.52,36.73,36.94,37.15,37.37,37.58,37.80,38.02,38.24,38.46,38.69,38.91,39.13,39.36,39.59,39.82,40.05,40.28,40.51,40.75,40.98,41.22,41.46,41.70,41.94,42.18,42.43,42.67,42.92,43.17,43.42,43.67,43.92,44.18,44.43,44.69,44.95,45.21,45.47,45.73,46.00,46.27,46.53,46.80,47.07,47.35,47.62,47.90,48.17,48.45,48.73,49.01,49.30,49.58,49.87,50.16,50.45,50.74,51.04,51.33,51.63,51.93,52.23,52.53,52.83,53.14,53.45,53.76,54.07,54.38,54.70,55.01,55.33,55.65,55.97,56.30,56.62,56.95,57.28,57.61,57.95,58.28,58.62,58.96,59.30,59.64,59.99,60.34,60.69,61.04,61.39,61.75,62.10,62.46,62.82,63.19,63.55,63.92,64.29,64.66,65.04,65.41,65.79,66.17,66.56,66.94,67.33,67.72,68.11,68.51,68.90,69.30,69.70,70.11,70.51,70.92,71.33,71.74,72.16,72.58,73.00,73.42,73.84,74.27,74.70,75.13,75.57,76.01,76.45,76.89,77.33,77.78,78.23,78.69,79.14,79.60,80.06,80.52,80.99,81.46,81.93,82.40,82.88,83.36,83.84,84.33,84.82,85.31,85.80,86.30,86.80,87.30,87.81,88.31,88.83,89.34,89.86,90.38,90.90,91.43,91.96,92.49,93.02,93.56,94.10,94.65,95.20,95.75,96.30,96.86,97.42
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Partial transposition¶

In [19]:
transpose_edited = NSGData.from_tiff("./edited/transpose.tiff")
transpose_edited.audio()
transpose_edited.show()
Importing tiff c with shape:  torch.Size([2, 1172, 1951])
torch.Size([1172, 1951])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.16,28.33,28.49,28.65,28.82,28.99,29.15,29.32,29.49,29.66,29.84,30.01,30.18,30.36,30.53,30.71,30.89,31.07,31.25,31.43,31.61,31.79,31.98,32.16,32.35,32.53,32.72,32.91,33.10,33.29,33.49,33.68,33.88,34.07,34.27,34.47,34.67,34.87,35.07,35.27,35.48,35.68,35.89,36.10,36.31,36.52,36.73,36.94,37.15,37.37,37.58,37.80,38.02,38.24,38.46,38.69,38.91,39.13,39.36,39.59,39.82,40.05,40.28,40.51,40.75,40.98,41.22,41.46,41.70,41.94,42.18,42.43,42.67,42.92,43.17,43.42,43.67,43.92,44.18,44.43,44.69,44.95,45.21,45.47,45.73,46.00,46.27,46.53,46.80,47.07,47.35,47.62,47.90,48.17,48.45,48.73,49.01,49.30,49.58,49.87,50.16,50.45,50.74,51.04,51.33,51.63,51.93,52.23,52.53,52.83,53.14,53.45,53.76,54.07,54.38,54.70,55.01,55.33,55.65,55.97,56.30,56.62,56.95,57.28,57.61,57.95,58.28,58.62,58.96,59.30,59.64,59.99,60.34,60.69,61.04,61.39,61.75,62.10,62.46,62.82,63.19,63.55,63.92,64.29,64.66,65.04,65.41,65.79,66.17,66.56,66.94,67.33,67.72,68.11,68.51,68.90,69.30,69.70,70.11,70.51,70.92,71.33,71.74,72.16,72.58,73.00,73.42,73.84,74.27,74.70,75.13,75.57,76.01,76.45,76.89,77.33,77.78,78.23,78.69,79.14,79.60,80.06,80.52,80.99,81.46,81.93,82.40,82.88,83.36,83.84,84.33,84.82,85.31,85.80,86.30,86.80,87.30,87.81,88.31,88.83,89.34,89.86,90.38,90.90,91.43,91.96,92.49,93.02,93.56,94.10,94.65,95.20,95.75,96.30,96.86,97.42
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Partial Transposition - 2¶

In [20]:
transpose_edited_2 = NSGData.from_tiff("./edited/transpose_2.tiff")
transpose_edited_2.audio()
transpose_edited_2.show()
Importing tiff c with shape:  torch.Size([2, 1172, 1951])
torch.Size([1172, 1951])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.16,28.33,28.49,28.65,28.82,28.99,29.15,29.32,29.49,29.66,29.84,30.01,30.18,30.36,30.53,30.71,30.89,31.07,31.25,31.43,31.61,31.79,31.98,32.16,32.35,32.53,32.72,32.91,33.10,33.29,33.49,33.68,33.88,34.07,34.27,34.47,34.67,34.87,35.07,35.27,35.48,35.68,35.89,36.10,36.31,36.52,36.73,36.94,37.15,37.37,37.58,37.80,38.02,38.24,38.46,38.69,38.91,39.13,39.36,39.59,39.82,40.05,40.28,40.51,40.75,40.98,41.22,41.46,41.70,41.94,42.18,42.43,42.67,42.92,43.17,43.42,43.67,43.92,44.18,44.43,44.69,44.95,45.21,45.47,45.73,46.00,46.27,46.53,46.80,47.07,47.35,47.62,47.90,48.17,48.45,48.73,49.01,49.30,49.58,49.87,50.16,50.45,50.74,51.04,51.33,51.63,51.93,52.23,52.53,52.83,53.14,53.45,53.76,54.07,54.38,54.70,55.01,55.33,55.65,55.97,56.30,56.62,56.95,57.28,57.61,57.95,58.28,58.62,58.96,59.30,59.64,59.99,60.34,60.69,61.04,61.39,61.75,62.10,62.46,62.82,63.19,63.55,63.92,64.29,64.66,65.04,65.41,65.79,66.17,66.56,66.94,67.33,67.72,68.11,68.51,68.90,69.30,69.70,70.11,70.51,70.92,71.33,71.74,72.16,72.58,73.00,73.42,73.84,74.27,74.70,75.13,75.57,76.01,76.45,76.89,77.33,77.78,78.23,78.69,79.14,79.60,80.06,80.52,80.99,81.46,81.93,82.40,82.88,83.36,83.84,84.33,84.82,85.31,85.80,86.30,86.80,87.30,87.81,88.31,88.83,89.34,89.86,90.38,90.90,91.43,91.96,92.49,93.02,93.56,94.10,94.65,95.20,95.75,96.30,96.86,97.42
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

RGB Encoding¶

In [22]:
electro = NSGData.from_wav("./samples/electro_masking.wav",
GaborSystemParams(
    scale=Oct,
    n_b=120,
    fmin=28,
    fmax=24000,
    fs=None,
    Ls=None,
    reducedform=0
))

electro.to_tiff("./images/electro.tiff", colormode="rgb")
electro.show()
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.16,28.33,28.49,28.65,28.82,28.99,29.15,29.32,29.49,29.66,29.84,30.01,30.18,30.36,30.53,30.71,30.89,31.07,31.25,31.43,31.61,31.79,31.98,32.16,32.35,32.53,32.72,32.91,33.10,33.29,33.49,33.68,33.88,34.07,34.27,34.47,34.67,34.87,35.07,35.27,35.48,35.68,35.89,36.10,36.31,36.52,36.73,36.94,37.15,37.37,37.58,37.80,38.02,38.24,38.46,38.69,38.91,39.13,39.36,39.59,39.82,40.05,40.28,40.51,40.75,40.98,41.22,41.46,41.70,41.94,42.18,42.43,42.67,42.92,43.17,43.42,43.67,43.92,44.18,44.43,44.69,44.95,45.21,45.47,45.73,46.00,46.27,46.53,46.80,47.07,47.35,47.62,47.90,48.17,48.45,48.73,49.01,49.30,49.58,49.87,50.16,50.45,50.74,51.04,51.33,51.63,51.93,52.23,52.53,52.83,53.14,53.45,53.76,54.07,54.38,54.70,55.01,55.33,55.65,55.97,56.30,56.62,56.95,57.28,57.61,57.95,58.28,58.62,58.96,59.30,59.64,59.99,60.34,60.69,61.04,61.39,61.75,62.10,62.46,62.82,63.19,63.55,63.92,64.29,64.66,65.04,65.41,65.79,66.17,66.56,66.94,67.33,67.72,68.11,68.51,68.90,69.30,69.70,70.11,70.51,70.92,71.33,71.74,72.16,72.58,73.00,73.42,73.84,74.27,74.70,75.13,75.57,76.01,76.45,76.89,77.33,77.78,78.23,78.69,79.14,79.60,80.06,80.52,80.99,81.46,81.93,82.40,82.88,83.36,83.84,84.33,84.82,85.31,85.80,86.30,86.80,87.30,87.81,88.31,88.83,89.34,89.86,90.38,90.90,91.43,91.96,92.49,93.02,93.56,94.10,94.65,95.20,95.75,96.30,96.86,97.42
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
torch.Size([1172, 1951, 3])
Saved complex spectrogram to ./images/electro.tiff with (1172, 1951, 3) shape
No description has been provided for this image

RGB encoding - edited¶

In [23]:
electro_edited = NSGData.from_tiff("./edited/transpose_rgb.tiff")
electro_edited.audio()
electro_edited.show()
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.16,28.33,28.49,28.65,28.82,28.99,29.15,29.32,29.49,29.66,29.84,30.01,30.18,30.36,30.53,30.71,30.89,31.07,31.25,31.43,31.61,31.79,31.98,32.16,32.35,32.53,32.72,32.91,33.10,33.29,33.49,33.68,33.88,34.07,34.27,34.47,34.67,34.87,35.07,35.27,35.48,35.68,35.89,36.10,36.31,36.52,36.73,36.94,37.15,37.37,37.58,37.80,38.02,38.24,38.46,38.69,38.91,39.13,39.36,39.59,39.82,40.05,40.28,40.51,40.75,40.98,41.22,41.46,41.70,41.94,42.18,42.43,42.67,42.92,43.17,43.42,43.67,43.92,44.18,44.43,44.69,44.95,45.21,45.47,45.73,46.00,46.27,46.53,46.80,47.07,47.35,47.62,47.90,48.17,48.45,48.73,49.01,49.30,49.58,49.87,50.16,50.45,50.74,51.04,51.33,51.63,51.93,52.23,52.53,52.83,53.14,53.45,53.76,54.07,54.38,54.70,55.01,55.33,55.65,55.97,56.30,56.62,56.95,57.28,57.61,57.95,58.28,58.62,58.96,59.30,59.64,59.99,60.34,60.69,61.04,61.39,61.75,62.10,62.46,62.82,63.19,63.55,63.92,64.29,64.66,65.04,65.41,65.79,66.17,66.56,66.94,67.33,67.72,68.11,68.51,68.90,69.30,69.70,70.11,70.51,70.92,71.33,71.74,72.16,72.58,73.00,73.42,73.84,74.27,74.70,75.13,75.57,76.01,76.45,76.89,77.33,77.78,78.23,78.69,79.14,79.60,80.06,80.52,80.99,81.46,81.93,82.40,82.88,83.36,83.84,84.33,84.82,85.31,85.80,86.30,86.80,87.30,87.81,88.31,88.83,89.34,89.86,90.38,90.90,91.43,91.96,92.49,93.02,93.56,94.10,94.65,95.20,95.75,96.30,96.86,97.42
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Erasing harmonics¶

In [13]:
erasure = NSGData.from_wav("./samples/erasure.wav",
GaborSystemParams(
    scale=Oct,
    n_b=120,
    fmin=28,
    fmax=24000,
    fs=None,
    Ls=None,
    reducedform=0 
))

erasure.to_tiff("./images/erasure.tiff", colormode="miniswhite")
erasure.audio()
erasure.show()
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.16,28.33,28.49,28.65,28.82,28.99,29.15,29.32,29.49,29.66,29.84,30.01,30.18,30.36,30.53,30.71,30.89,31.07,31.25,31.43,31.61,31.79,31.98,32.16,32.35,32.53,32.72,32.91,33.10,33.29,33.49,33.68,33.88,34.07,34.27,34.47,34.67,34.87,35.07,35.27,35.48,35.68,35.89,36.10,36.31,36.52,36.73,36.94,37.15,37.37,37.58,37.80,38.02,38.24,38.46,38.69,38.91,39.13,39.36,39.59,39.82,40.05,40.28,40.51,40.75,40.98,41.22,41.46,41.70,41.94,42.18,42.43,42.67,42.92,43.17,43.42
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
torch.Size([2, 1172, 4373])
Saved complex spectrogram to ./images/erasure.tiff with (2, 1172, 4373) shape
Your browser does not support the audio element.
No description has been provided for this image

Erasing harmonics - edited¶

In [14]:
erasure_edited = NSGData.from_tiff("./edited/erasure-difference.tiff")
erasure_edited.audio()
erasure_edited.show()
Importing tiff c with shape:  torch.Size([2, 1172, 4373])
torch.Size([1172, 4373])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.16,28.33,28.49,28.65,28.82,28.99,29.15,29.32,29.49,29.66,29.84,30.01,30.18,30.36,30.53,30.71,30.89,31.07,31.25,31.43,31.61,31.79,31.98,32.16,32.35,32.53,32.72,32.91,33.10,33.29,33.49,33.68,33.88,34.07,34.27,34.47,34.67,34.87,35.07,35.27,35.48,35.68,35.89,36.10,36.31,36.52,36.73,36.94,37.15,37.37,37.58,37.80,38.02,38.24,38.46,38.69,38.91,39.13,39.36,39.59,39.82,40.05,40.28,40.51,40.75,40.98,41.22,41.46,41.70,41.94,42.18,42.43,42.67,42.92,43.17,43.42
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Pitch warping - original¶

In [26]:
quack = NSGData.from_wav("./samples/quack.wav", 
GaborSystemParams(
    scale=Oct,
    n_b=60,
    fmin=28,
    fmax=24000,
    fs=None,
    Ls=None,
    reducedform=0
)) 

quack.to_tiff("./images/quack.tiff")
quack.audio()
quack.show()
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.33,28.65,28.99,29.32,29.66,30.01,30.36,30.71,31.07,31.43,31.79,32.16,32.53,32.91,33.29,33.68,34.07,34.47,34.87,35.27,35.68,36.10,36.52,36.94,37.37,37.80,38.24,38.69,39.13,39.59,40.05,40.51,40.98,41.46,41.94,42.43,42.92,43.42,43.92,44.43,44.95,45.47,46.00,46.53,47.07,47.62,48.17,48.73,49.30,49.87,50.45,51.04,51.63,52.23,52.83,53.45,54.07,54.70,55.33,55.97,56.62,57.28,57.95,58.62,59.30,59.99,60.68,61.39,62.10,62.82,63.55,64.29,65.04,65.79,66.56,67.33,68.11,68.90,69.70,70.51,71.33,72.16,73.00,73.84,74.70,75.57,76.45,77.33,78.23,79.14,80.06,80.99,81.93,82.88,83.84,84.82,85.80,86.80,87.80,88.82,89.86,90.90,91.95,93.02,94.10,95.20,96.30,97.42,98.55,99.69,100.85,102.02,103.21,104.41,105.62,106.84,108.09,109.34,110.61,111.89,113.19,114.51,115.84,117.18,118.54,119.92,121.31,122.72,124.15,125.59,127.05,128.52,130.01,131.52,133.05,134.59,136.16,137.74,139.34,140.96,142.59,144.25,145.92,147.62,149.33,151.07,152.82,154.59,156.39,158.20,160.04,161.90,163.78,165.68,167.61,169.55,171.52,173.51,175.53,177.56,179.63,181.71,183.82,185.96,188.12,190.30,192.51,194.75,197.01,199.29,201.61,203.95,206.32,208.71,211.14,213.59,216.07,218.58,221.11,223.68,226.28,228.91,231.56,234.25,236.97,239.73,242.51,245.32,248.17,251.06,253.97,256.92,259.90,262.92,265.97,269.06,272.19,275.35,278.54,281.78,285.05,288.36,291.71
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
torch.Size([2, 580, 591])
Saved complex spectrogram to ./images/quack.tiff with (2, 580, 591) shape
Your browser does not support the audio element.
No description has been provided for this image

Pitch warping - edited¶

In [27]:
quack_edited = NSGData.from_tiff("./edited/quack.tiff")
quack_edited.audio()
quack_edited.show()
Importing tiff c with shape:  torch.Size([2, 580, 591])
torch.Size([580, 591])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.33,28.65,28.99,29.32,29.66,30.01,30.36,30.71,31.07,31.43,31.79,32.16,32.53,32.91,33.29,33.68,34.07,34.47,34.87,35.27,35.68,36.10,36.52,36.94,37.37,37.80,38.24,38.69,39.13,39.59,40.05,40.51,40.98,41.46,41.94,42.43,42.92,43.42,43.92,44.43,44.95,45.47,46.00,46.53,47.07,47.62,48.17,48.73,49.30,49.87,50.45,51.04,51.63,52.23,52.83,53.45,54.07,54.70,55.33,55.97,56.62,57.28,57.95,58.62,59.30,59.99,60.68,61.39,62.10,62.82,63.55,64.29,65.04,65.79,66.56,67.33,68.11,68.90,69.70,70.51,71.33,72.16,73.00,73.84,74.70,75.57,76.45,77.33,78.23,79.14,80.06,80.99,81.93,82.88,83.84,84.82,85.80,86.80,87.80,88.82,89.86,90.90,91.95,93.02,94.10,95.20,96.30,97.42,98.55,99.69,100.85,102.02,103.21,104.41,105.62,106.84,108.09,109.34,110.61,111.89,113.19,114.51,115.84,117.18,118.54,119.92,121.31,122.72,124.15,125.59,127.05,128.52,130.01,131.52,133.05,134.59,136.16,137.74,139.34,140.96,142.59,144.25,145.92,147.62,149.33,151.07,152.82,154.59,156.39,158.20,160.04,161.90,163.78,165.68,167.61,169.55,171.52,173.51,175.53,177.56,179.63,181.71,183.82,185.96,188.12,190.30,192.51,194.75,197.01,199.29,201.61,203.95,206.32,208.71,211.14,213.59,216.07,218.58,221.11,223.68,226.28,228.91,231.56,234.25,236.97,239.73,242.51,245.32,248.17,251.06,253.97,256.92,259.90,262.92,265.97,269.06,272.19,275.35,278.54,281.78,285.05,288.36,291.71
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Vocal repair¶

In [15]:
bad_vocal = NSGData.from_wav("./samples/bad_vocal.wav", 
GaborSystemParams(
    scale=Oct,
    n_b=48,
    fmin=10,
    fmax=24000,
    fs=None,
    Ls=None,
    reducedform=0
))

bad_vocal.to_tiff("./images/bad_vocal.tiff")
bad_vocal.show()
bad_vocal.audio()
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 10.00,10.15,10.29,10.44,10.59,10.75,10.91,11.06,11.22,11.39,11.55,11.72,11.89,12.06,12.24,12.42,12.60,12.78,12.97,13.16,13.35,13.54,13.74,13.94,14.14,14.35,14.56,14.77,14.98,15.20,15.42,15.65,15.87,16.10,16.34,16.58,16.82,17.06,17.31,17.56,17.82,18.08,18.34,18.61,18.88,19.15,19.43,19.71,20.00,20.29,20.59,20.88,21.19,21.50,21.81,22.13,22.45,22.78,23.11,23.44,23.78,24.13,24.48,24.84,25.20,25.56,25.94,26.31,26.70,27.08,27.48,27.88,28.28,28.69,29.11,29.54,29.97,30.40,30.84,31.29,31.75,32.21,32.68,33.15,33.63,34.12,34.62,35.12,35.63,36.15,36.68,37.21,37.75,38.30,38.86,39.42,40.00,40.58,41.17,41.77,42.38,42.99,43.62,44.25,44.90,45.55,46.21,46.88,47.57,48.26,48.96,49.67,50.39,51.13,51.87,52.63,53.39,54.17,54.96,55.75,56.57,57.39,58.22,59.07,59.93,60.80,61.68,62.58,63.49,64.42,65.35,66.30,67.27,68.25,69.24,70.25,71.27,72.30,73.36,74.42,75.50,76.60,77.72,78.85,79.99,81.16,82.34,83.54,84.75,85.98,87.23,88.50,89.79,91.10,92.42,93.77,95.13,96.51,97.92,99.34,100.79,102.25,103.74,105.25,106.78
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
torch.Size([2, 542, 1749])
Saved complex spectrogram to ./images/bad_vocal.tiff with (2, 542, 1749) shape
Your browser does not support the audio element.
No description has been provided for this image

Vocal repair - modified¶

In [16]:
bad_vocal_r = NSGData.from_tiff("./edited/bad_vocal.tiff")
bad_vocal_r.audio()
bad_vocal_r.show()
Importing tiff c with shape:  torch.Size([2, 542, 1749])
torch.Size([542, 1749])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 10.00,10.15,10.29,10.44,10.59,10.75,10.91,11.06,11.22,11.39,11.55,11.72,11.89,12.06,12.24,12.42,12.60,12.78,12.97,13.16,13.35,13.54,13.74,13.94,14.14,14.35,14.56,14.77,14.98,15.20,15.42,15.65,15.87,16.10,16.34,16.58,16.82,17.06,17.31,17.56,17.82,18.08,18.34,18.61,18.88,19.15,19.43,19.71,20.00,20.29,20.59,20.88,21.19,21.50,21.81,22.13,22.45,22.78,23.11,23.44,23.78,24.13,24.48,24.84,25.20,25.56,25.94,26.31,26.70,27.08,27.48,27.88,28.28,28.69,29.11,29.54,29.97,30.40,30.84,31.29,31.75,32.21,32.68,33.15,33.63,34.12,34.62,35.12,35.63,36.15,36.68,37.21,37.75,38.30,38.86,39.42,40.00,40.58,41.17,41.77,42.38,42.99,43.62,44.25,44.90,45.55,46.21,46.88,47.57,48.26,48.96,49.67,50.39,51.13,51.87,52.63,53.39,54.17,54.96,55.75,56.57,57.39,58.22,59.07,59.93,60.80,61.68,62.58,63.49,64.42,65.35,66.30,67.27,68.25,69.24,70.25,71.27,72.30,73.36,74.42,75.50,76.60,77.72,78.85,79.99,81.16,82.34,83.54,84.75,85.98,87.23,88.50,89.79,91.10,92.42,93.77,95.13,96.51,97.92,99.34,100.79,102.25,103.74,105.25,106.78
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Instrument isolation with time-stretching - original¶

In [32]:
# Load a sample and convert to NSGT
trumpet = NSGData.from_wav("./samples/trumpet.wav", 
    GaborSystemParams(
        scale=Oct,
        n_b=60,
        fmin=28,
        fmax=24000,
        fs=None,
        Ls=None,
        reducedform=0
    )
)

# Save to TIFF for potential editing
trumpet.to_tiff("./images/trumpet.tiff")
trumpet.audio()
trumpet.show()
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.33,28.65,28.99,29.32,29.66,30.01,30.36
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
torch.Size([2, 588, 6217])
Saved complex spectrogram to ./images/trumpet.tiff with (2, 588, 6217) shape
Your browser does not support the audio element.
No description has been provided for this image

Instrument isolation with time-stretching - edited¶

In [33]:
trumpet_edited = NSGData.from_tiff("./edited/trumpet.tiff")
trumpet_edited.audio()
trumpet_edited.show()
Importing tiff c with shape:  torch.Size([2, 588, 6217])
torch.Size([588, 6217])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.33,28.65,28.99,29.32,29.66,30.01,30.36
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Manual brush removal - original¶

In [34]:
msbwy = NSGData.from_wav("./samples/msbwy.wav", 
GaborSystemParams(
    scale=Oct,
    n_b=60,
    fmin=28,
    fmax=24000,
    fs=None,
    Ls=None,
    reducedform=0
))

msbwy.to_tiff("./images/msbwy.tiff")
msbwy.audio()
msbwy.show()
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.33,28.65,28.99,29.32,29.66,30.01,30.36,30.71,31.07,31.43,31.79,32.16,32.53,32.91,33.29,33.68,34.07,34.47,34.87,35.27,35.68,36.10,36.52,36.94,37.37,37.80,38.24,38.69,39.13,39.59,40.05,40.51,40.98,41.46,41.94,42.43,42.92,43.42,43.92,44.43,44.95,45.47,46.00,46.53,47.07,47.62,48.17,48.73,49.30,49.87,50.45,51.04,51.63,52.23,52.83,53.45,54.07,54.70,55.33,55.97,56.62,57.28,57.95,58.62,59.30,59.99,60.68,61.39,62.10,62.82,63.55,64.29,65.04,65.79,66.56
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
torch.Size([2, 580, 2575])
Saved complex spectrogram to ./images/msbwy.tiff with (2, 580, 2575) shape
Your browser does not support the audio element.
No description has been provided for this image

Manual brush removal - edited¶

In [35]:
msbwy_edited = NSGData.from_tiff("./edited/msbwy.tiff")
msbwy_edited.audio()
msbwy_edited.show()
Importing tiff c with shape:  torch.Size([2, 1158, 1303])
torch.Size([1158, 1303])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.16,28.33,28.49,28.65,28.82,28.99,29.15,29.32,29.49,29.66,29.84,30.01,30.18,30.36,30.53,30.71,30.89,31.07,31.25,31.43,31.61,31.79,31.98,32.16,32.35,32.53,32.72,32.91,33.10,33.29,33.49,33.68,33.88,34.07,34.27,34.47,34.67,34.87,35.07,35.27,35.48,35.68,35.89,36.10,36.31,36.52,36.73,36.94,37.15,37.37,37.58,37.80,38.02,38.24,38.46,38.69,38.91,39.13,39.36,39.59,39.82,40.05,40.28,40.51,40.75,40.98,41.22,41.46,41.70,41.94,42.18,42.43,42.67,42.92,43.17,43.42,43.67,43.92,44.18,44.43,44.69,44.95,45.21,45.47,45.73,46.00,46.27,46.53,46.80,47.07,47.35,47.62,47.90,48.17,48.45,48.73,49.01,49.30,49.58,49.87,50.16,50.45,50.74,51.04,51.33,51.63,51.93,52.23,52.53,52.83,53.14,53.45,53.76,54.07,54.38,54.70,55.01,55.33,55.65,55.97,56.30,56.62,56.95,57.28,57.61,57.95,58.28,58.62,58.96,59.30,59.64,59.99,60.34,60.69,61.04,61.39,61.75,62.10,62.46,62.82,63.19,63.55,63.92,64.29,64.66,65.04,65.41,65.79,66.17,66.56,66.94,67.33,67.72,68.11,68.51,68.90,69.30,69.70,70.11,70.51,70.92,71.33,71.74,72.16,72.58,73.00,73.42,73.84,74.27,74.70,75.13,75.57,76.01,76.45,76.89,77.33,77.78,78.23,78.69,79.14,79.60,80.06,80.52,80.99,81.46,81.93,82.40,82.88,83.36,83.84,84.33,84.82,85.31,85.80,86.30,86.80,87.30,87.81,88.31,88.83,89.34,89.86,90.38,90.90,91.43,91.96,92.49,93.02,93.56,94.10,94.65,95.20,95.75,96.30,96.86,97.42,97.98,98.55,99.12,99.70,100.27,100.85,101.44,102.02,102.61,103.21,103.81,104.41,105.01,105.62,106.23,106.85,107.46,108.09,108.71,109.34,109.97,110.61,111.25,111.90,112.54,113.20,113.85,114.51,115.17,115.84,116.51,117.18,117.86,118.54,119.23,119.92,120.62,121.31,122.02,122.72,123.43,124.15,124.87,125.59,126.32,127.05,127.78,128.52,129.27,130.01,130.77,131.52,132.29,133.05,133.82
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Pitch correction via stretching - original¶

In [ ]:
violin = NSGData.from_wav("./samples/vibrato.wav", 
GaborSystemParams(
    scale=Oct,
    n_b=120,
    fmin=30,
    fmax=24000,
    fs=None,
    Ls=None,
    reducedform=0
))

violin.to_tiff("./images/vibrato.tiff")
violin.audio()
violin.show()
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 30.00,30.17,30.35,30.52,30.70,30.88,31.06,31.24,31.42,31.60,31.78,31.97,32.15,32.34,32.53,32.71,32.90,33.09,33.28,33.48,33.67,33.87,34.06,34.26,34.46,34.66,34.86,35.06,35.26,35.47,35.67,35.88,36.09,36.30,36.51,36.72,36.93,37.14,37.36,37.57,37.79,38.01,38.23,38.45,38.67,38.90,39.12,39.35,39.58,39.81,40.04,40.27,40.50,40.74,40.97,41.21,41.45,41.69,41.93,42.17,42.42,42.66,42.91,43.16,43.41,43.66,43.91,44.17,44.42,44.68,44.94,45.20,45.46,45.72,45.99,46.25,46.52,46.79,47.06,47.33,47.61,47.88,48.16,48.44,48.72,49.00,49.29,49.57,49.86,50.15,50.44,50.73,51.02,51.32,51.62,51.91,52.21,52.52,52.82,53.13,53.43,53.74,54.05,54.37,54.68,55.00,55.32,55.64,55.96,56.28,56.61,56.94,57.27,57.60,57.93,58.27,58.60,58.94,59.29,59.63,59.97,60.32,60.67,61.02,61.37,61.73,62.09,62.45,62.81,63.17,63.54,63.91,64.28,64.65,65.02,65.40,65.78,66.16,66.54,66.93,67.31,67.70,68.10,68.49,68.89,69.28,69.69,70.09,70.49,70.90,71.31,71.73,72.14,72.56,72.98,73.40,73.83,74.25,74.68,75.12,75.55,75.99,76.43,76.87,77.32,77.76,78.21,78.67,79.12,79.58,80.04,80.50,80.97,81.44,81.91,82.38,82.86,83.34,83.82,84.31,84.80,85.29,85.78,86.28,86.78,87.28,87.79,88.29,88.81,89.32,89.84,90.36,90.88,91.41,91.93,92.47,93.00,93.54,94.08,94.63,95.17,95.73,96.28,96.84,97.40,97.96,98.53,99.10,99.67,100.25,100.83,101.41,102.00,102.59,103.19,103.78,104.38,104.99,105.60,106.21,106.82,107.44,108.06,108.69,109.32,109.95,110.59,111.23,111.87,112.52,113.17,113.83,114.48,115.15,115.81,116.48,117.16,117.84,118.52,119.21,119.90,120.59,121.29,121.99,122.70,123.41,124.12,124.84,125.56,126.29,127.02,127.76,128.49,129.24,129.99,130.74,131.50,132.26,133.02,133.79,134.57,135.35,136.13,136.92,137.71,138.51,139.31,140.12,140.93,141.74,142.56,143.39,144.22,145.06,145.89,146.74,147.59,148.44,149.30,150.17,151.04,151.91,152.79,153.67,154.56,155.46,156.36,157.26,158.18,159.09,160.01,160.94,161.87,162.81,163.75,164.70,165.65,166.61,167.57,168.54,169.52,170.50,171.49,172.48,173.48,174.48,175.49,176.51,177.53,178.56,179.59,180.63,181.68,182.73,183.79,184.85,185.92,187.00,188.08,189.17,190.27,191.37,192.48,193.59,194.71,195.84
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
torch.Size([2, 1146, 893])
Saved complex spectrogram to ./images/vibrato.tiff with (2, 1146, 893) shape
Your browser does not support the audio element.
No description has been provided for this image

Pitch correction via stretching - edited¶

In [38]:
violin_edited = NSGData.from_tiff("./edited/vibrato.tiff")
violin_edited.audio()
violin_edited.show()
Importing tiff c with shape:  torch.Size([2, 1158, 893])
torch.Size([1158, 893])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 28.00,28.16,28.33,28.49,28.65,28.82,28.99,29.15,29.32,29.49,29.66,29.84,30.01,30.18,30.36,30.53,30.71,30.89,31.07,31.25,31.43,31.61,31.79,31.98,32.16,32.35,32.53,32.72,32.91,33.10,33.29,33.49,33.68,33.88,34.07,34.27,34.47,34.67,34.87,35.07,35.27,35.48,35.68,35.89,36.10,36.31,36.52,36.73,36.94,37.15,37.37,37.58,37.80,38.02,38.24,38.46,38.69,38.91,39.13,39.36,39.59,39.82,40.05,40.28,40.51,40.75,40.98,41.22,41.46,41.70,41.94,42.18,42.43,42.67,42.92,43.17,43.42,43.67,43.92,44.18,44.43,44.69,44.95,45.21,45.47,45.73,46.00,46.27,46.53,46.80,47.07,47.35,47.62,47.90,48.17,48.45,48.73,49.01,49.30,49.58,49.87,50.16,50.45,50.74,51.04,51.33,51.63,51.93,52.23,52.53,52.83,53.14,53.45,53.76,54.07,54.38,54.70,55.01,55.33,55.65,55.97,56.30,56.62,56.95,57.28,57.61,57.95,58.28,58.62,58.96,59.30,59.64,59.99,60.34,60.69,61.04,61.39,61.75,62.10,62.46,62.82,63.19,63.55,63.92,64.29,64.66,65.04,65.41,65.79,66.17,66.56,66.94,67.33,67.72,68.11,68.51,68.90,69.30,69.70,70.11,70.51,70.92,71.33,71.74,72.16,72.58,73.00,73.42,73.84,74.27,74.70,75.13,75.57,76.01,76.45,76.89,77.33,77.78,78.23,78.69,79.14,79.60,80.06,80.52,80.99,81.46,81.93,82.40,82.88,83.36,83.84,84.33,84.82,85.31,85.80,86.30,86.80,87.30,87.81,88.31,88.83,89.34,89.86,90.38,90.90,91.43,91.96,92.49,93.02,93.56,94.10,94.65,95.20,95.75,96.30,96.86,97.42,97.98,98.55,99.12,99.70,100.27,100.85,101.44,102.02,102.61,103.21,103.81,104.41,105.01,105.62,106.23,106.85,107.46,108.09,108.71,109.34,109.97,110.61,111.25,111.90,112.54,113.20,113.85,114.51,115.17,115.84,116.51,117.18,117.86,118.54,119.23,119.92,120.62,121.31,122.02,122.72,123.43,124.15,124.87,125.59,126.32,127.05,127.78,128.52,129.27,130.01,130.77,131.52,132.29,133.05,133.82,134.60,135.38,136.16,136.95,137.74,138.54,139.34,140.15,140.96,141.77,142.59,143.42,144.25,145.09,145.93,146.77,147.62,148.47,149.33,150.20,151.07,151.94,152.82,153.71,154.60,155.49,156.39,157.30,158.21,159.12,160.04,160.97,161.90,162.84,163.78,164.73,165.68,166.64,167.61,168.58,169.56,170.54,171.52,172.52,173.52,174.52,175.53,176.55,177.57,178.60,179.63,180.67,181.72,182.77,183.83,184.89,185.96,187.04,188.12,189.21,190.30,191.41,192.51,193.63,194.75,195.88
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image

Synthesis¶

In [36]:
synthesis_edited = NSGData.from_tiff("./edited/synthesis.tiff")
synthesis_edited.audio()
synthesis_edited.show()
Importing tiff c with shape:  torch.Size([2, 542, 1749])
torch.Size([542, 1749])
c:\Projects\nsgt-3\src\frame.py:83: UserWarning: Q-factor too high for frequencies 10.00,10.15,10.29,10.44,10.59,10.75,10.91,11.06,11.22,11.39,11.55,11.72,11.89,12.06,12.24,12.42,12.60,12.78,12.97,13.16,13.35,13.54,13.74,13.94,14.14,14.35,14.56,14.77,14.98,15.20,15.42,15.65,15.87,16.10,16.34,16.58,16.82,17.06,17.31,17.56,17.82,18.08,18.34,18.61,18.88,19.15,19.43,19.71,20.00,20.29,20.59,20.88,21.19,21.50,21.81,22.13,22.45,22.78,23.11,23.44,23.78,24.13,24.48,24.84,25.20,25.56,25.94,26.31,26.70,27.08,27.48,27.88,28.28,28.69,29.11,29.54,29.97,30.40,30.84,31.29,31.75,32.21,32.68,33.15,33.63,34.12,34.62,35.12,35.63,36.15,36.68,37.21,37.75,38.30,38.86,39.42,40.00,40.58,41.17,41.77,42.38,42.99,43.62,44.25,44.90,45.55,46.21,46.88,47.57,48.26,48.96,49.67,50.39,51.13,51.87,52.63,53.39,54.17,54.96,55.75,56.57,57.39,58.22,59.07,59.93,60.80,61.68,62.58,63.49,64.42,65.35,66.30,67.27,68.25,69.24,70.25,71.27,72.30,73.36,74.42,75.50,76.60,77.72,78.85,79.99,81.16,82.34,83.54,84.75,85.98,87.23,88.50,89.79,91.10,92.42,93.77,95.13,96.51,97.92,99.34,100.79,102.25,103.74,105.25,106.78
  warn("Q-factor too high for frequencies %s"%",".join("%.2f"%fi for fi in f[q >= qneeded]))
Your browser does not support the audio element.
No description has been provided for this image